//商品
var invoice = {
	id:"",
	course:null,
	carData:""
};

//商品详情
invoice.detail = function(){
	var args = getQueryStringArgs();
	invoice.id = args["id"];
	var ajax = new $ax(Feng.ctxPath+"/invoice/getById", function(data){
        Feng.log("查询详情成功");
        if (data.success){
//          product.course = data.obj.course;    
			template.helper('invoiceTypeFormat', function (inp) {
		       if(inp==="1") return "个人";
		       else if(inp==="2") return "公司";
		    }); 
		     //发票状态
        	template.helper('applyStatusFormat', function (inp) {
		        if(inp==="1"){ 
		        	return "申请中";
		        }
		       else if(inp==="2") return "已处理";
		    }); 
			var detailHtml = template("dataTmpl",data.obj);
            $(".aui-myOrder-content").after(detailHtml);
            
           
        }
    },function(data){
        Feng.error("查询详情失败!");
    });
    ajax.set("id",invoice.id);
    ajax.start();
}




$(function(){	
	invoice.detail();	
//	product.carLength();
});
